home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-15 | 2.2 KB | 62 lines | [TEXT/MPS ] |
-
- { Stand-alone code modules which need to use global variables
- may include the interfaces in this unit. Such code modules
- must also be linked with Runtime.o and SAGlobals.o. }
-
- UNIT SAGlobals;
-
- INTERFACE
-
- USES
- Types, Memory, OSUtils;
-
- TYPE
- A5RefType = Handle;
-
- { MakeA5World allocates space for an A5 world based on the
- size of the global variables defined by the module and its
- units. If sufficient space is not available, MakeA5World
- returns NIL for A5Ref and further initialization is aborted. }
- PROCEDURE MakeA5World (VAR A5Ref: A5RefType);
-
- { SetA5World locks down a previously-allocated handle containing
- an A5 world and sets the A5 register appropriately. The return
- value is the old value of A5 and the client should save it for
- use by RestoreA5World. }
- FUNCTION SetA5World (A5Ref: A5RefType) : Longint;
-
- { RestoreA5World restores A5 to its original value (which the
- client should have saved) and unlocks the A5 world to avoid
- heap fragmentation in cases where the world is used again. }
- PROCEDURE RestoreA5World (oldA5: Longint; A5Ref: A5RefType);
-
- { DisposeA5World simply disposes of the A5 world handle. }
- PROCEDURE DisposeA5World (A5Ref: A5RefType);
-
- { OpenA5World combines MakeA5World and SetA5World for the majority
- of cases in which these two routines are called consecutively. An
- exception is when a single A5 world is invoked many times. In this
- case, the world is only created once with MakeA5World and it is
- invoked each time by SetA5World. Most developers will find it easier
- just to call OpenA5World and CloseA5World at the end. If the memory
- allocation request fails, OpenA5World returns NIL for A5Ref and zero
- in the function result. }
- FUNCTION OpenA5World (VAR A5Ref: A5RefType) : Longint;
-
- { CloseA5World is the dual of OpenA5World. It combines RestoreA5World
- and DisposeA5World. Again, in certain cases it may be necessary to
- call those two routines explicitly, but most of the time CloseA5World
- is all that is required. }
- PROCEDURE CloseA5World (oldA5: Longint; A5Ref: A5RefType);
-
-
- {$IFC UNDEFINED BuildLib}
- {$SETC BuildLib := 0}
- {$ENDC}
-
- {$IFC BuildLib}
- {$I SAGlobals.inc1.p}
- {$ENDC}
-
- END.
-